package iosr11.data;

public class ProjectSubject extends Entity{
	private String topic;
	private String description;
	private ProjectGroup group;
	
	public ProjectSubject(){
		
	}
	
	public ProjectSubject(String id, String topic, String description){
		super(id);
		this.topic = topic;
		this.description = description;
	}
	
	public String getTopic() {
		return topic;
	}

	public void setTopic(String topic) {
		this.topic = topic;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public ProjectGroup getGroup() {
		return group;
	}
	
	public boolean isFree() {
		if (this.group==null)
			return true;
		else
			return false;
	}

	public void setGroup(ProjectGroup group) {
		this.group = group;
	}

	public String toString(){
		StringBuffer buf = new StringBuffer();
		buf.append("id: ");
		buf.append(this.getId());
		buf.append("\n");
		buf.append("topic: ");
		buf.append(topic);
		buf.append("\n");
		buf.append("description: ");
		buf.append(description);
		buf.append("\n");
		return buf.toString();
	}

}
